Step 1: Create the report in EMu

As with any other report, the first step is to build the report in EMu.

Note: For full details of how to create the report in EMu, see Step 1: Create the report in EMu.

Note: Ensure that Microsoft Word is closed before creating a new report.

In the Loans module in EMu:

  1. On the Report Type tab of the Report Properties box, select Microsoft Word from the Type drop list.
  2. Select the Fields tab.

    The Fields tab will appear similar to:

    Fields

    For details about adding fields see 2. Select the fields to include in the report: the Fields tab, where you will find an explanation for how to convert table fields (indicated by a Nested table icon icon beside the field name) to text using the Table as Text Table as text option. Converting a table field to text greatly simplifies the coding required to include its data in a report: when a table field is converted to text its data is included in the main .csv file generated when the report is run in EMu, rather than being exported as a separate .csv file.

    Note: Fields that are both an attachment field AND a table of values - Object: (Objects Loaned) in the example above - CANNOT be included in the main .csv file using the Table as Text Table as text option. In this case it is necessary to add additional Visual Basic Code to the mail merge report in order to include data from the additional .csv file(s) in the report. We look at how to do this later.

  3. Run the report in EMu.

When we run this report two .csv files will be generated:

  • eloans.csv (which is the main .csv file and contains data from the Loans and Parties modules)
  • ObjObjec.csv (which contains data from the Catalogue module)

We will look at creating a report where:

  • Only one .csv file is generated

    In this example, we use the main .csv file (eloans.csv). In the majority of cases in which only a single .csv file is generated when a report is run out of EMu, the steps described here are all you will require to create a mail merge report. At this stage the report will include details about the loan and the borrower (but not the objects loaned)

    Note: The steps described here for connecting to the DSN are required whether you have one or more than one .csv file to access.

  • More than one .csv file is generated

    We will then adapt our report to access data included in the second .csv file (ObjObjec.csv) in order to include details about the objects loaned.